home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-05-01 | 5.6 KB | 186 lines | [TEXT/MPS ] |
- % ---------------------------------------------------------------------------
- % Class MACWindow
- %
- % In this module you find the programmers interface to Windows.
- % It is built on top of the TOOLBOX routines in TOOLBOXWindows.
- % For a description of the routines see Inside Macintosh, chapter 9.
- %
- % 890317/Boris Magnusson
- %
- % ---------------------------------------------------------------------------
- External class TOOLBOXWindow="::SInterfaces:ToolboxWindow";
- External class MacToolConst="::SInterfaces:MacToolConst";
- External class MacQuickdraw="::SInterfaces:MacQuickdraw";
- external class MACEvent="::SInterfaces:MACEvent";
- external class MACPoint="::SInterfaces:MACPoint";
- external class MACRect="::SInterfaces:MACRect";
-
- MacQuickdraw class MACWindow;
- begin
- integer NIL=0; ! Pascal constant ;
- ref(TOOLBOXWindow) TRAP; ! To access Window Toolbox traps ;
- ref(MacToolConst) TConst; ! To access Tool Toolbox Constants ;
- ref(macUtilities) Util; ! To access Utilities ;
- ! ---------------------------;
- !for Window Manager;
-
- procedure ClipAbove; TRAP.TOOLBOXClipAbove(WindowPtr);
-
- procedure PaintOne(clobbered);integer clobbered;
- TRAP.TOOLBOXPaintOne(WindowPtr,clobbered);
-
- procedure PaintBehind(clobbered);integer clobbered;
- TRAP.TOOLBOXPaintBehind(WindowPtr,clobbered);
-
- procedure SaveOld; TRAP.TOOLBOXSaveOld(WindowPtr);
-
- procedure DrawNew(fUpdate);Boolean fUpdate;
- TRAP.TOOLBOXDrawNew(WindowPtr,fUpdate);
-
- procedure CalcVis; TRAP.TOOLBOXCalcVis(WindowPtr);
-
- procedure CalcVisBehind(clobbered);integer clobbered;
- TRAP.TOOLBOXCalcVisBehind(WindowPtr,clobbered);
-
- procedure ShowHide(showFlag);Boolean showFlag;
- TRAP.TOOLBOXShowHide(WindowPtr,showFlag);
-
- Boolean procedure CheckUpdate(E); ref(MACEvent) E;
- CheckUpdate:=TRAP.TOOLBOXCheckUpdate(E.what);
-
- procedure NewWindow(bounds,title,visible,theProc,behind,
- goAwayFlag,refCon);
- ref(MACRect) bounds;
- text title;
- boolean visible;
- short integer theproc;
- ref(MACWindow) behind;
- Boolean goAwayFlag;
- integer refCon;
- begin
- text t;
- t:-util.text_string(title);
- Windowptr:=TRAP.TOOLBOXNewWindow
- (NIL,bounds.top,t,visible,theProc,
- if behind==none then NIL else behind.WindowPtr,
- goAwayFlag,refCon);
- end;
-
- procedure GetNewWindow(windowID,behind);
- short integer windowID; ref(MACWindow) behind;
- begin
- Windowptr:=TRAP.TOOLBOXGetNewWindow(windowID,NIL,
- if behind==none then NIL else behind.WindowPtr);
- end;
- procedure CloseWindow; TRAP.TOOLBOXCloseWindow(WindowPtr);
- procedure DisposeWindow; TRAP.TOOLBOXDisposeWindow(WindowPtr);
-
- procedure MoveWindow(h, v,BringToFront);
- short integer h,v;Boolean BringToFront;
- TRAP.TOOLBOXMoveWindow(WindowPtr,h, v,BringToFront);
-
- procedure SizeWindow(width,height,fUpdate);
- short integer width,height; Boolean fUpdate;
- TRAP.TOOLBOXSizeWindow(WindowPtr,width,height,fUpdate);
-
- integer procedure GrowWindow(startPt,bBox);
- ref(MACPoint) startPt;
- ref(MACRect) bBox;
- GrowWindow:=TRAP.TOOLBOXGrowWindow(Windowptr,
- startPt.h,startPt.v,
- bBox.top);
-
- procedure DragWindow(startPt,bounds);
- ref(MACPoint) startPt;
- ref(MACRect) bounds;
- TRAP.TOOLBOXDragWindow(Windowptr,startPt.h,startPt.v,bounds.top);
-
- procedure ShowWindow; TRAP.TOOLBOXShowWindow(WindowPtr);
- procedure HideWindow; TRAP.TOOLBOXHideWindow(WindowPtr);
-
- procedure SetWTitle(title); text title;
- begin
- text temp;
- temp:-Util.text_string(title);
- TRAP.TOOLBOXSetWTitle(WindowPtr,temp );
- end;
-
- procedure GetWTitle(title);name title; text title;
- begin
- text temp;
- temp:-blanks(256);
- TRAP.TOOLBOXGetWTitle(WindowPtr,temp );
- Title:-Util.string_text(temp);
- end;
-
- procedure HiliteWindow(fHiLite);Boolean fHiLite;
- TRAP.TOOLBOXHiliteWindow(WindowPtr, fHiLite);
-
- procedure BeginUpdate; TRAP.TOOLBOXBeginUpdate(WindowPtr);
- procedure EndUpdate; TRAP.TOOLBOXEndUpdate(WindowPtr);
-
- procedure SetWRefCon(data);integer data;
- TRAP.TOOLBOXSetWRefCon(WindowPtr,data);
-
- integer procedure GetWRefCon;
- GetWRefCon:=TRAP.TOOLBOXGetWRefCon(WindowPtr);
-
- procedure SetWindowPic(thePic);integer thePic; ! PicHandle;
- TRAP.TOOLBOXSetWindowPic(WindowPtr,thePic);
-
- integer procedure GetWindowPic;
- GetWindowPic:=TRAP.TOOLBOXGetWindowPic(WindowPtr); ! returns Pic Handle !;
-
- procedure BringToFront; TRAP.TOOLBOXBringToFront(WindowPtr);
-
- procedure SendBehind(behind);ref(MACWindow) Behind;
- TRAP.TOOLBOXSendBehind(WindowPtr,behind.WindowPtr);
-
- Boolean procedure TrackGoAway(thePt); ref(MACPoint) thePt;
- TrackGoAway:=TRAP.TOOLBOXTrackGoAway(WindowPtr,thePt.h,thePt.v);
-
- procedure DrawGrowIcon;
- TRAP.TOOLBOXDrawGrowIcon(WindowPtr);
-
- !new 128K ROM;
-
- Boolean procedure TrackBox(thePt,partCode);
- ref(MACPoint) thePt;
- integer partCode;
- TrackBox:=TRAP.TOOLBOXTrackBox(WindowPtr,thePt.h,thePt.v,partCode);
-
- procedure ZoomWindow(partCode,front);
- integer partCode;
- Boolean front;
- TRAP.TOOLBOXZoomWindow(WindowPtr,partCode,front);
-
- ! --- Belong somewhere else ???------------- ;
-
- % external TRAP.TOOLBOX procedure x="$A92A" is
- % ValidRect(goodRect: Rect);;
- %
- % external TRAP.TOOLBOX procedure x="$A929" is
- % ValidRgn(goodRgn: RgnHandle);;
- %
- % external TRAP.TOOLBOX procedure x="$A928" is
- % InvalRect(badRect: Rect);;
- %
- % external TRAP.TOOLBOX procedure x="$A927" is
- % InvalRgn(badRgn: RgnHandle);;
- %
- % external TRAP.TOOLBOX procedure x="$A94E" is
- % PinRect(theRect: Rect; thePt: Point): LONGINT;;
- %
- % external TRAP.TOOLBOX procedure x="$A905" is
- % DragGrayRgn(theRgn: RgnHandle; startPt: Point; boundsRect,
- % slopRect: Rect; axis: INTEGER;
- % actionProc: ProcPtr): LONGINT;;
-
- % ??? procedure TRAP.TOOLBOXGetWMgrPort(GrafPtr);integer GrafPtr;;
-
-
- TRAP:-new TOOLBOXWindow;
- TConst:-new MacToolConst;
- Util:- new MacUtilities;
- END --- class MAC WINDOW --- ;
-